package org.xg.study.pd.test;

import com.alibaba.fastjson.JSONObject;
import org.junit.Test;

import java.util.ArrayList;

/**
 * @author CMG
 * @version 1.0
 * @cLassName ApiTest4_00
 * @description
 * @date 2021/9/13 13:56
 **/
public class ApiTest4_00 {
    @Test
    public void test_clone(){
        ArrayList<String> l00 = new ArrayList<>();
        l00.add("xxx");
        l00.add("yyy");

        ArrayList<String> l01 = (ArrayList<String>) l00.clone();
        l01.add("zzz");

        System.out.println(JSONObject.toJSONString(l00));
        System.out.println(JSONObject.toJSONString(l01));

        l01.remove("xxx");

        System.out.println(JSONObject.toJSONString(l00));
        System.out.println(JSONObject.toJSONString(l01));
    }
}
